package com.example.sys.async.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.example.core.enums.SysEnum;
import com.example.sys.async.handler.ASyncHandler;
import com.example.sys.async.handler.EmailASyncHandler;
import com.example.sys.async.handler.MQAsyncHandler;
import com.example.sys.async.handler.SmsASyncHandler;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

@Getter
public enum SysASyncType implements SysEnum {

    SMS("短信服务", "SMS", SmsASyncHandler.class), EMAIL("邮件服务", "EMAIL", EmailASyncHandler.class), MQ("MQ消息", "MQ", MQAsyncHandler.class);

    @JsonValue
    private String label;

    @EnumValue
    private String value;

    private Class<? extends ASyncHandler> handler;

    @Override
    public java.lang.String getValue() {
        return value;
    }

    @Override
    public java.lang.String getLabel() {
        return label;
    }

    SysASyncType(String label, String value, Class<? extends ASyncHandler> handler) {
        this.label = label;
        this.value = value;
        this.handler = handler;
    }
}
